<?php

require_once 'common/conn.php';

if (isset($_GET['nickname'])) {
    $nickname = $_GET['nickname'];
}

$data = array();
$db = new DBC();
if (isset($nickname)) {
    $sql = "SELECT *,devicecode AS usercode FROM t_device WHERE nickname = '" . $nickname . "'";
    $data = $db->fetchData($sql);
}
echo json_encode($data);
?>